// app/middleware/cors.js
module.exports = (options, app) => {
    return async function cors(ctx, next) {
      ctx.set('Access-Control-Allow-Origin', '*');
      ctx.set('Access-Control-Allow-Methods', 'GET,HEAD,PUT,POST,DELETE,PATCH');
      ctx.set('Access-Control-Allow-Headers', 'Content-Type, Authorization');
      await next();
    };
  };